use std::collections::HashMap;
#[allow(dead_code)]
pub fn new_count_distinct2(input_str: &str) -> usize {
    let word_vec: Vec<&str> = input_str.split(',').collect();
    // println!("{:?},word_vec.len()={}", word_vec, word_vec.len());
    let mut dict = HashMap::with_capacity(word_vec.len());
    let mut answer = 0;
    for i in &word_vec {
        answer += 1;
        // println!("i={},outside answer={}", i, answer);
        dict.entry(i)
            .and_modify(|_| {
                answer -= 1;
                // println!("answer={}", answer);
            })
            .or_insert(i);
    }
    answer
}
// 别人的标准答案
pub fn new_count_distinct(input_str: &str) -> usize {
    use std::collections::HashSet;
    let mut elements = HashSet::new();
    for item in input_str.split(',') {
        elements.insert(item);
    }
    elements.len()
}
